﻿// <copyright file="EasyWebApp.cs" company="<Customer Name>">This is a "work-for-hire".</copyright><author><Class Author's Name></author>

/*
 *      Title:    <Class Description>
 *      Module:   ClassTemplate (<Namespace>:ClassTemplate.cs)
 *      Project:  <Project Name>
 *      Customer: <Customer Name>
 *      Facility: MicroCODE Incorporated
 *      Date:     <Class Creation Date>
 *      Author:   <Class Author's Name>
 * 
 * 
 * 
 *  
 *      MODIFICATIONS:
 *      --------------
 *
 *  Date:         By-Group:   Rev:     Description:
 *
 *  DD-Mmm-YYYY   XYZ-GROUP  {0001}    Describe reason for creating or modifying class... 
 * 
 * 
 * 
 */
using System;
using Org.EasyWeb.SysUtil;

namespace Org.EasyWeb.Exception
{
    /// <summary>
    /// 页面功能被禁止而抛出的异常
    /// </summary>
    public class DisableFuncException : ErrorPageException
    {
        private string[] STYLE_STRS = {
											  "", // custom
											  "新建", // insert
											  "修改", // update
											  "删除", // delete
											  "详细", // detail
											  "列表"
										  }; // list

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="name">功能模块的注册名</param>
        /// <param name="style">页面类型</param>
        public DisableFuncException(string name, int style)
            : base()
        {
            String errorMsg = string.Format(EasyWebResUtil.GetResourceString("DisableFunc_Body"), name, STYLE_STRS[style]);
            ErrorBody = errorMsg;
            ErrorTitle = EasyWebResUtil.GetResourceString("DisableFunc_ErrorTitle");
            PageTitle = EasyWebResUtil.GetResourceString("DisableFunc_PageTitle");
        }
    }
}
